/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package OtherPubs;

import Rout.ChromeProfile;
import Rout.TestCase;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

/**
 *
 * @author user
 */
public class chromeMobile implements TestCase{
    Process p;
    RemoteWebDriver driver;
    
    @BeforeMethod
    public void Before() throws Exception {
//        try {
//    p = Runtime.getRuntime().exec("/home/user/Selenium_Server/./chromedriver");    
//    } catch (IOException e) {
//        // TODO Auto-generated catch block
//        e.printStackTrace();
//    }
        //Capability
        DesiredCapabilities capabilities = new DesiredCapabilities();
        
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.setExperimentalOption("androidPackage", "com.android.chrome");
        chromeOptions.addArguments("--enable-strict-powerful-feature-restrictions");
        chromeOptions.addArguments("--disable-translate");       
        capabilities.setCapability("locationContextEnabled", true);        
        capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
        driver = new ChromeDriver(capabilities);
    }
    
    @Test
    public void Test() throws Exception {
        driver.get("http://shameonu.tk");
        Thread.sleep(777);
        System.out.println(driver.getTitle());
        
        
    }
    
    @AfterMethod
    public void TearsDown() throws Exception {
        driver.close();
        
    }
    
}
